/*
 * qiangungun.com Inc.
 * Copyright (c) 2014 All Rights Reserved.
 */package com.qiangungun.report.dal.ibatis;import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;import com.qiangungun.report.dal.daointerface.RptcfgDefineDatasetRelDAO;// auto generated importsimport java.util.List;import org.springframework.dao.DataAccessException;import com.qiangungun.report.dal.dataobject.RptcfgDefineDatasetRelDO;/** * An ibatis based implementation of dao interface <tt>com.qiangungun.report.dal.daointerface.RptcfgDefineDatasetRelDAO</tt>. * * This file is generated by <tt>financenet-dalgen</tt>, a DAL (Data Access Layer)
 * code generation utility specially developed for <tt>iwallet</tt> project.
 * 
 * PLEASE DO NOT MODIFY THIS FILE MANUALLY, or else your modification may
 * be OVERWRITTEN by someone else. To modify the file, you should go to 
 * directory <tt>(project-home)/biz/dal/src/conf/dalgen</tt>, and 
 * find the corresponding configuration file (<tt>tables/rptcfg_define_dataset_rel.xml</tt>). 
 * Modify the configuration file according to your needs, then run <tt>financenet-dalgen</tt> 
 * to generate this file.
 *
 */@SuppressWarnings({"unchecked","deprecation"})public class IbatisRptcfgDefineDatasetRelDAO extends SqlMapClientDaoSupport implements RptcfgDefineDatasetRelDAO {	/**
	 *  Query DB table <tt>rptcfg_define_dataset_rel</tt> for records.
	 *
	 *  <p>
	 *  The sql statement for this operation is <br>
	 *  <tt>select ID, DEFINE_ID, DATASET_ID, RELATE_STATUS from rptcfg_define_dataset_rel</tt>
	 *
	 *	@return List<RptcfgDefineDatasetRelDO>
	 *	@throws DataAccessException
	 */	 
    public List<RptcfgDefineDatasetRelDO> loadAll() throws DataAccessException {

        return getSqlMapClientTemplate().queryForList("MS-RPTCFG-DEFINE-DATASET-REL-LOAD-ALL", null);

    }		/**
	 *  Query DB table <tt>rptcfg_define_dataset_rel</tt> for records.
	 *
	 *  <p>
	 *  The sql statement for this operation is <br>
	 *  <tt>select ID, DEFINE_ID, DATASET_ID, RELATE_STATUS from rptcfg_define_dataset_rel where (DEFINE_ID = ?)</tt>
	 *
	 *	@param defineId
	 *	@return RptcfgDefineDatasetRelDO
	 *	@throws DataAccessException
	 */	 
    public RptcfgDefineDatasetRelDO queryByDefineId(Long defineId) throws DataAccessException {

        return (RptcfgDefineDatasetRelDO) getSqlMapClientTemplate().queryForObject("MS-RPTCFG-DEFINE-DATASET-REL-QUERY-BY-DEFINE-ID", defineId);

    }		/**
	 *  Insert one <tt>RptcfgDefineDatasetRelDO</tt> object to DB table <tt>rptcfg_define_dataset_rel</tt>, return primary key
	 *
	 *  <p>
	 *  The sql statement for this operation is <br>
	 *  <tt>insert into rptcfg_define_dataset_rel(ID,DEFINE_ID,DATASET_ID,RELATE_STATUS) values (?, ?, ?, ?)</tt>
	 *
	 *	@param rptcfgDefineDatasetRel
	 *	@return Long
	 *	@throws DataAccessException
	 */	 
    public Long insert(RptcfgDefineDatasetRelDO rptcfgDefineDatasetRel) throws DataAccessException {
    	if (rptcfgDefineDatasetRel == null) {
    		throw new IllegalArgumentException("Can't insert a null data object into db.");
    	}
    	
        getSqlMapClientTemplate().insert("MS-RPTCFG-DEFINE-DATASET-REL-INSERT", rptcfgDefineDatasetRel);

        return rptcfgDefineDatasetRel.getId();
    }		/**
	 *  Delete records from DB table <tt>rptcfg_define_dataset_rel</tt>.
	 *
	 *  <p>
	 *  The sql statement for this operation is <br>
	 *  <tt>delete from rptcfg_define_dataset_rel where (ID = ?)</tt>
	 *
	 *	@param rptcfgDefineDatasetRel
	 *	@return int
	 *	@throws DataAccessException
	 */	 
    public int delete(RptcfgDefineDatasetRelDO rptcfgDefineDatasetRel) throws DataAccessException {
    	if (rptcfgDefineDatasetRel == null) {
    		throw new IllegalArgumentException("Can't delete by a null data object.");
    	}


        return getSqlMapClientTemplate().delete("MS-RPTCFG-DEFINE-DATASET-REL-DELETE", rptcfgDefineDatasetRel);
    }	/**
	 *  Update DB table <tt>rptcfg_define_dataset_rel</tt>.
	 *
	 *  <p>
	 *  The sql statement for this operation is <br>
	 *  <tt>update rptcfg_define_dataset_rel set DEFINE_ID=?, DATASET_ID=?, RELATE_STATUS=? where (ID = ?)</tt>
	 *
	 *	@param rptcfgDefineDatasetRel
	 *	@return int
	 *	@throws DataAccessException
	 */	 
    public int update(RptcfgDefineDatasetRelDO rptcfgDefineDatasetRel) throws DataAccessException {
    	if (rptcfgDefineDatasetRel == null) {
    		throw new IllegalArgumentException("Can't update by a null data object.");
    	}


        return getSqlMapClientTemplate().update("MS-RPTCFG-DEFINE-DATASET-REL-UPDATE", rptcfgDefineDatasetRel);
    }	}	